# $Id: PKGBUILD 82931 2013-01-25 21:40:40Z spupykin $
# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor: Sergej Pupykin <pupykin.s+arch@gmail.com>

pkgname=yahoo-t
pkgver=0.4
pkgrel=6
pkgdesc="jabber yahoo transport"
arch=('any')
url="http://xmpppy.sourceforge.net/yahoo/"
license=('GPL')
depends=('python2' 'xmpppy')
backup=(etc/ejabberd/yahoo.xml)
source=(http://downloads.sourceforge.net/xmpppy/yahoo-transport-$pkgver.tar.gz
	yahoo.rc
	yahoo-t.service)
md5sums=('ce928c4e444b83f10fca57f77e40b558'
         'b44e5dc83e0689c998858bf5284ecc0b'
         'e093f7f45c1bd755b6b0f13e83ec3276')

build()
{
  cd $srcdir
  rm -rf yahoo-transport-$pkgver/curphoo/CVS
  install -D -m0644 ./yahoo-transport-$pkgver/config_example.xml $pkgdir/etc/ejabberd/yahoo.xml

  install -d -m0755 $pkgdir/usr/lib
  cp -r yahoo-transport-$pkgver $pkgdir/usr/lib

  mv $pkgdir/usr/lib/yahoo-transport-$pkgver $pkgdir/usr/lib/yahoo-t
  ln -s ../../../etc/ejabberd/yahoo.xml $pkgdir/usr/lib/yahoo-t/config.xml
  install -D -m0755 yahoo.rc $pkgdir/etc/rc.d/yahoo-t
  find $pkgdir -type f -name \*.py -exec sed -i 's#/usr/bin/env python#/usr/bin/env python2#' {} \;

  install -Dm0644 $srcdir/$pkgname.service $pkgdir/usr/lib/systemd/system/$pkgname.service
}
